﻿<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<div th:replace="pages/admin/commons/header :: header"></div>
<!--<link href="https://cdn.bootcss.com/twitter-bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">-->
<!--<link href="https://cdn.bootcss.com/twitter-bootstrap/3.0.1/css/bootstrap.min.css" rel="stylesheet">-->
<style>
    .curPage {
        color: red !important;
    }

    /* start 拿到bootstrap导航条样式*/

    .nav1 {
        margin-top: 2%;
    }

    .pagination > li {
        display: inline
    }

    .pagination > li > a, .pagination > li > span {
        position: relative;
        float: left;
        padding: 6px 12px;
        line-height: 1.42857143;
        text-decoration: none;
        color: #428bca;
        background-color: #fff;
        border: 1px solid #ddd;
        margin-left: -1px
    }

    .pagination > li:first-child > a, .pagination > li:first-child > span {
        margin-left: 0;
        border-bottom-left-radius: 4px;
        border-top-left-radius: 4px
    }

    .pagination > li:last-child > a, .pagination > li:last-child > span {
        border-bottom-right-radius: 4px;
        border-top-right-radius: 4px
    }

    .pagination > li > a:hover, .pagination > li > span:hover, .pagination > li > a:focus, .pagination > li > span:focus {
        color: #2a6496;
        background-color: #eee;
        border-color: #ddd
    }

    /* end 拿到bootstrap导航条样式*/

</style>
<body>
<div class="wap-container">
    <nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">
        首页
        <span class="c-gray en">/</span>
        资讯管理
        <span class="c-gray en">/</span>
        资讯列表
        <a class="btn btn-success radius f-r" style="line-height:1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
    <article class="Hui-admin-content clearfix">
        <div class="panel">
            <form action="getPersonnelCode" method="post">
                <div class="panel-body">
                    <div class="row clearfix">
                        <div class="col-xs-12 col-sm-6 col-md-4">
                            <div class="row clearfix mb-10">
                                <span class="col-xs-4 form-item-label">编号：</span>
                                <span class="col-xs-8 form-item-control">
									<input type="text" name="bianhao" placeholder="编号"
                                           class="input-text"/>
								</span>
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-6 col-md-4">
                            <div class="row clearfix mb-10">
                                <span class="col-xs-4 form-item-label">姓名：</span>
                                <span class="col-xs-8 form-item-control">
									<input type="text" name="name" placeholder="姓名"
                                           class="input-text"/>
								</span>
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-6 col-md-4">
                            <div class="row clearfix mb-10">
                                <span class="col-xs-4 form-item-label">开始日期：</span>
                                <span class="col-xs-8 form-item-control">
									<input type="text" name="start" id="search-datetime-start"
                                           class="input-text datetimepicker-input">
								</span>
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-6 col-md-4">
                            <div class="row clearfix mb-10">
                                <span class="col-xs-4 form-item-label">结束日期：</span>
                                <span class="col-xs-8 form-item-control">
									<input type="text" name="end" id="search-datetime-end"
                                           class="input-text datetimepicker-input">
								</span>
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-6 col-md-4">
                            <div class="row clearfix">
								<span class="col-xs-4 form-item-control">
									<button name="" id="search-submit" class="btn btn-success radius" type="submit"><i
                                            class="Hui-iconfont">&#xe665;</i> 查询</button>
								</span>
                            </div>
                        </div>
                    </div>
                </div>

            </form>

        </div>
        <div class="panel-body">
            <div class="clearfix">
                    <span style="display: contents"
                          class="f-r">共有数据：<strong>[[${allPersonnelCode.getTotalElements()}]]</strong> 条</span>
                <a style="float: right; margin-right: 5%;" href="javascript:;" id="add_record"
                   class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加数据</a>

                <!--						<span class="f-l">-->
                <!--						<a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>-->
                <!--						</span>-->
            </div>
            <div class="mt-20 clearfix">
                <table id="data-table-list"
                       class="table table-border table-bordered table-bg table-hover table-sort" style="">
                    <thead>
                    <tr class="text-c">
                        <!--									<th width="25"><input type="checkbox" name="" value=""></th>-->
                        <th width="100">编码</th>
                        <th width="60">姓名</th>
                        <th width="60">拼音编码</th>
                        <th width="20">性别</th>
                        <th width="80">类别</th>
                        <th width="100">出生日期</th>
                        <th width="20">年龄</th>
                        <th width="120">操作</th>
                    </tr>
                    </thead>
                    <tbody class="getData-list" data-currPage='1'>
                    <tr th:each="c : ${allPersonnelCode.content}"
                        class="text-c">
                        <!--									<td><input type="checkbox" value="" name=""></td>-->
                        <td><span class="label label-success radius">[[${c.personnelCoding}]]</span></td>
                        <td class="text-l">[[${c.name}]]</td>
                        <td>[[${c.pinyinCoding}]]</td>
                        <td>[[${c.gender}]]</td>
                        <td>[[${c.category}]]</td>
                        <td>[[${#dates.format(c.birthDate,'yyyy-MM-dd HH:mm:ss')}]]</td>
                        <td class="td-status">[[${c.age}]]</td>
                        <td class="f-14 td-manage">
                            <button th:uniqueId="${c.id}" class="btn btn-success radius updBtn"
                                    type="button"><i
                                    class="Hui-iconfont"></i> 修改
                            </button>
                            <button th:uniqueId="${c.id}" class="btn btn-danger radius delBtn"
                                    type="button"><i
                                    class="Hui-iconfont"></i> 删除
                            </button>
                        </td>
                    </tr>

                    </tbody>
                </table>
            </div>
            <!--                分页导航-->
            <nav class="nav1" style="float: right" aria-label="Page navigation">
                <ul class="pagination">
                    <li>
                        <a th:href="@{'/personnelCode/getPersonnelCode?page=' +${allPersonnelCode.getNumber()-1}}">上一页</a>
                    </li>
                    <li>
                        <a th:href="@{'/personnelCode/getPersonnelCode?page=' + ${i} + '&size=10'}"
                           th:each="i :${#numbers.sequence(0, allPersonnelCode.getTotalPages()-1)}"
                           th:text="${i} +1"
                           th:class="${allPersonnelCode.getNumber() == i}? 'curPage' :'' "></a>
                    </li>

                    <li>
                        <a th:href="@{'/personnelCode/getPersonnelCode?page=' +${allPersonnelCode.getNumber()+1}}">下一页</a>
                    </li>
                </ul>
            </nav>
        </div>

    </article>
</div>
<div th:replace="pages/admin/commons/footer :: footer"></div>
<script type="text/javascript">

    $(function () {
        runDatetimePicker(); // 实例化日期控件


        //删除
        $(".delBtn").on('click', function () {
            var uniqueId = $(this).attr("uniqueId");
            layer.confirm('是否确定删除: ' + $(this).parent().parent().find('td').eq(1).text() + ' ？', {
                btn: ['删除', '取消'] //按钮
            }, function () {
                layer.msg('删除成功！', {icon: 1});
                setTimeout(function () {
                    window.location.href = "/childhealth/personnelCode/data-del?id=" + uniqueId;
                }, 1000)
            });

        })


        //修改
        $(".updBtn").on('click', function () {
            member_add('修改', '/childhealth/personnelCode/data-toUpd?type=toUpd&id=' + $(this).attr("uniqueId"), '', '510')
        })


        //添加记录
        $("#add_record").click(function () {
            member_add('添加', '/childhealth/personnelCode/data-toUpd?type=toAdd', '510')
        })

    });
</script>
</body>
</html>
